import Vue from 'vue'
import Router from 'vue-router'

const Recommend = () => import('@/views/recommend/Recommend')
const Rank = () => import('@/views/rank/Rank')
const Singer = () => import('@/views/singer/Singer')
const SingerDetail = () => import('@/components/singerDetail/SingerDetail')
const Search = () => import('@/views/search/Search')

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  linkActiveClass: 'active',
  routes: [
    {
      path: '/',
      redirect: '/recommend'
    },
    {
      path: '/recommend',
      name: 'recommend',
      component: Recommend
    },
    {
      path: '/rank',
      name: 'rank',
      component: Rank
    },
    {
      path: '/singer',
      name: 'singer',
      component: Singer,
      children: [
        {
          path: ':id',
          component: SingerDetail
        }
      ]
    },
    {
      path: '/search',
      name: 'search',
      component: Search
    }
  ]
})
